package deconstruction.deconTable;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiMerchant;
import net.minecraft.client.gui.inventory.GuiBeacon;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.ResourceLocation;

import org.lwjgl.opengl.GL11;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import deconstruction.common.Info;

@SideOnly(Side.CLIENT)
public class GuiButtonDecon extends GuiButton
{
    /**
     * If true, then next page button will face to right, if false then next page button will face to left.
     */
    private final boolean mirrored;
    public static String text = "";
    protected GuiDeconstruction beaconGui;

    public GuiButtonDecon(int par1, int par2, int par3, boolean par4)
    {
        super(par1, par2, par3, 12, 19, "");
        this.mirrored = par4;
        
    }
    public void func_82251_b(int par1, int par2){
    	super.func_82251_b(par1, par2);
    }
    

    /**
     * Draws this button to the screen.
     */
 
    public void drawButton(Minecraft par1Minecraft, int par2, int par3)
    {
        if (this.drawButton)
        {
            par1Minecraft.renderEngine.bindTexture(new ResourceLocation(Info.MOD_ID, "textures/gui/deconstruction.png"));
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            boolean flag = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + 12 && par3 < this.yPosition + 19;
            int k = 0;
            int l = 176;

            if (!this.enabled)
            {
                l += 12 * 2;
            }
            else if (flag)
            {
                l += 12;
            }

            if (!this.mirrored)
            {
                k += 19;
            }

            this.drawTexturedModalRect(this.xPosition, this.yPosition, l, k, 12, 19);
        }
    }

}
